import VueRouter from 'vue-router'

// 导入对应的路由组件
import HomeContainer from './components/tabbar/HomeContainer.vue'
import MemberContainer from './components/tabbar/MemberContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue'
//news 中的组件
import NewslistHome from './components/news/NewslistHome.vue'
import NewsInfo from './components/news/NewsInfo.vue'
//pohtos 中的组件
import PhotosList from './components/photos/PhotoList.vue'
import PhotosInfo from './components/photos/PhotoInfo.vue'
//goods 中的组件
import GoodList from './components/goods/GoodList.vue'
import GoodInfo from './components/goods/GoodInfo.vue'

// 3. 创建路由对象
var router = new VueRouter({
    routes:[//匹配路由规则
        // 路由重定向
        {path:'/',redirect:'/home'},
        {path:'/home',component:HomeContainer},
        {path:'/contact',component:MemberContainer},
        {path:'/cart',component:SearchContainer},
        {path:'/search',component:ShopcarContainer},
        {path:'/home/newshome',component:NewslistHome},
        {path:'/home/newsinfo/:id',component:NewsInfo},
        {path:'/home/photolist',component:PhotosList},
        {path:'/home/photoinfo/:id',component:PhotosInfo},
        {path:'/home/goodlist',component:GoodList},
        {path:'/home/goodinfo',component:GoodInfo}
    ],
    linkActiveClass:'mui-active',//覆盖默认的高亮的类，默认的类叫做 link-active-class
})

// 把路由暴露出去
export default router